package com.ewhale.feitengguest.api;

import com.ewhale.feitengguest.dto.ConversationDto;
import com.ewhale.feitengguest.dto.HaveUnreadMsgDto;
import com.ewhale.feitengguest.dto.MessageDetailDto;
import com.ewhale.feitengguest.dto.MessageDto;
import com.ewhale.feitengguest.dto.ShopMessageDto;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface MessageApi {

    /**
     * 获取消息公告列表
     * @param pageSize
     * @param pageNumber
     * @return
     */
    @FormUrlEncoded
    @POST("app/accountMessage/getAccountMessageDtoList.json")
    Observable<List<MessageDto>> getMessageList(@Field("pageSize") Integer pageSize,
                                                @Field("pageNumber") Integer pageNumber);

    /**
     * 获取消息详情
     * @return
     */
    @FormUrlEncoded
    @POST("app/accountMessage/getMessageView.json")
    Observable<MessageDetailDto> getMessageDetail(@Field("messageId") Long messageId);


    /**
     * 获取师徒列表
     * @return
     */
    @POST("app/account/getAccountMasterAndApprenticeList.json")
    Observable<ConversationDto> getAccountMasterAndApprenticeList();

    @FormUrlEncoded
    @POST("app/account/getAccountMasterAndApprenticeList.json")
    Observable<ConversationDto> getAccountMasterAndApprenticeList(@Field("keyWord") String keyWord);

    /**
     * 获取商家消息
     * @param pageNumber
     * @param pageSize
     * @param type
     * @return
     */
    @FormUrlEncoded
    @POST("app/shop/getMessage.json")
    Observable<List<ShopMessageDto>> getShopMessage(@Field("pageNumber") Integer pageNumber,
                                                    @Field("pageSize") Integer pageSize,
                                                    @Field("type") Integer type);
    //是否有未读消息
    @POST("app/accountMessage/HaveUnreadMsg.json")
    Observable<HaveUnreadMsgDto> haveMessageUnRead();

}
